package biz

import (
	"context"
	"github.com/go-kratos/kratos/v2/log"
	"gorm.io/gorm"
	"phm/models/generator/model"
)

type ScClassRepo interface {
	CreateScClass(ctx context.Context, uModel *model.ScClass, db *gorm.DB) error
	UpdateScClass(ctx context.Context, uModel *model.ScClass, db *gorm.DB) error
	DeleteScClassByIds(ctx context.Context, ids []string, db *gorm.DB) error
	GetScClassById(ctx context.Context, id string) (*model.ScClass, error)
	GetScClassByIds(ctx context.Context, ids []string) ([]*model.ScClass, error)
	GetScClassList(ctx context.Context, query string, pageNum, pageSize int64) ([]*model.ScClass, int64, error)
	// GetDB 得到db以方便事务处理
	GetDB() *gorm.DB
}

type ScClassUseCase struct {
	scClass ScClassRepo
	log     *log.Helper
}

func NewScClassUseCase(scClass ScClassRepo, logger log.Logger) *ScClassUseCase {
	return &ScClassUseCase{
		scClass: scClass,
		log:     log.NewHelper(logger),
	}
}
